home *** CD-ROM | disk | FTP | other *** search
/ New Perspectives on Computer Concepts / New Perspectives on Computer Concepts.iso / np2010c / page789.pag < prev    next >
Portable Network Graphic  |  2008-10-02  |  84KB  |  817x1045  |  8-bit (256 colors)
Labels: computer | crt screen | hakham | laptop | monitor | reckoner
OCR: COMPUTER PROGRAMMING 721 How do collect input from the user? If you think back to the proce- dural programming section of this chapter, you might recall that the BASIC program collected the size, shape, and price of each pizza by using Input statements such as: Input "Enter the size of pizzal Sizel That Input statement displayed the prompt "Enter the size of pizza1: and then stored the number entered in variable called Size1 Prolog has simi- lar capabilities. Examine the following progra am code to see how Prolog program collects user input, then take the screentour in Figure 12-51 to see how the program interacts with users when run Prolog uses the write predicate to display a prompt for input. write (user enter price of pizzal: The read predicate gathers read (user Pricel) assertz (pri i ...